package com.paishen.common.okhttp;

import com.google.gson.internal.$Gson$Types;
import com.squareup.okhttp.Request;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;

/**
 * https://github.com/lizhangqu/CoreProgress
 */
public class OkCallbackAdapter<T> {
    public final Type mType;

    public OkCallbackAdapter() {
        Type superclass = getClass().getGenericSuperclass();
        ParameterizedType parameterized = (ParameterizedType) superclass;
        mType = $Gson$Types.canonicalize(parameterized.getActualTypeArguments()[0]);
    }

    public void onResponse(T response, boolean fresh) {
    }

    public void onFailure(Request request, Exception e) {
    }

    public void onProgress(long bytesWrite, long contentLength, boolean done) {
    }

}